package com.leyou.trade.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.leyou.auth.utils.UserContext;
import com.leyou.trade.entity.OrderLogistics;
import com.leyou.trade.mapper.OrderLogisticsMapper;
import com.leyou.trade.service.OrderLogisticsService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;


@Service
public class OrderLogisticsServiceImpl extends ServiceImpl<OrderLogisticsMapper, OrderLogistics> implements OrderLogisticsService {
    @Override
    public List<OrderLogistics> getAddresssList() {
        List<OrderLogistics> list = query().eq("addressee", UserContext.getUser().getUsername()).list();
        list.forEach(s->{
            s.setId(UserContext.getUser().getId());
        });
        return list;
    }
}